<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="/js/plugin/layui-v2.3.0/layui/css/layui.css">
	<link rel="stylesheet" href="/css/reset.css">
	<link rel="stylesheet" href="/css/index.css">
	<link rel="stylesheet" href="/css/project_set.css">
	<script src="/js/jquery-2.1.1.min.js"></script>
	<script src="/js/plugin/layui-v2.3.0/layui/layui.js"></script>
	<script src="/js/common.js"></script>
<script>
	$(document).ready(function() {
		
		initFormSelects("dicIndustryId","/system/data-dic/selectjson/dic_customer_industry",$("#dicIndustry").val());
		initFormSelects("dicStageId","/system/data-dic/selectjson/dic_customer_stage",$("#dicStage").val());
		$(":radio[name='importantCustomer'][value='"+$("#importantCustomerid").val()+"']").attr("checked","checked"); 
		$(":radio[name='externallyVisible'][value='"+$("#externallyVisibleid").val()+"']").attr("checked","checked"); 
		$(":radio[name='enterpriseQualification'][value='"+$("#enterpriseQualificationid").val()+"']").attr("checked","checked"); 
		$("#invoiceType").val($("#invoiceTypeid").val());
		$("#automatic").val($("#automaticid").val());
		$("#chargeDocumentType").val($("#chargeDocumentTypeid").val());
	});
	
</script>
<style>
.layui-form-label{
	text-align:left
}
.kb-form-container{
	padding-left:20px;
}
.layui-form-item .layui-inline{
	margin-right:0px
}
</style>
</head>
<body style="overflow-y:scroll">
<input type="hidden" id="dicIndustry" name="dicIndustry" th:value="${record.dicIndustry} ? ${record.dicIndustry.id}:''" />
<input type="hidden" id="dicStage" name="dicStage" th:value="${record.dicStage}? ${record.dicStage.id}:''" />
<input type="hidden" id="importantCustomerid" name="importantCustomerid" th:value="${record.importantCustomer}" />
<input type="hidden" id="externallyVisibleid" name="externallyVisibleid" th:value="${record.externallyVisible}" />
<input type="hidden" id="enterpriseQualificationid" name="enterpriseQualificationid" th:value="${record.enterpriseQualification}" />
<input type="hidden" id="invoiceTypeid" name="invoiceTypeid" th:value="${record.invoiceType}" />
<input type="hidden" id="automaticid" name="automaticid" th:value="${record.automatic}" />
<input type="hidden" id="chargeDocumentTypeid" name="chargeDocumentTypeid" th:value="${record.chargeDocumentType}" />
<div class="addemployee-wrap" id="employee-wrap">
	<div class="kb-form-container" >
		<form class="layui-form" id="defaultForm" th:action="@{/app/customerTeam/update}" th:method="post" lay-filter="employee-form">
			<input type="hidden" id="id" name="id" th:value="${record.id}" />
			<fieldset class="fieldset">
				<div class="layui-form-item">
					<div class="layui-inline">
					    <label class="layui-form-label"><span class="must-fill">*</span>全称</label>
					    <div class="layui-input-inline" style="width:330px">
					      	<input type="text" name="fullName" id="fullName" th:value="${record.fullName}" required  lay-verify="fullName" placeholder="" autocomplete="off" class="layui-input">
					    	<span style="color: rgb(153, 153, 153); font-size: 12px; padding: 4px 0px 0px;">公司注册名称,与合同一致</span>
					    </div>
					</div>
					<div class="layui-inline">
					    <label class="layui-form-label" style="width:40px"><span class="must-fill">*</span>简称</label>
					    <div class="layui-input-inline" style="width:110px">
					    	<input type="text" name="simpleName" id="simpleName" th:value="${record.simpleName}" lay-verify="simpleName" placeholder="" autocomplete="off" class="layui-input">
					    	<span style="color: rgb(153, 153, 153); font-size: 12px; padding: 4px 0px 0px;">如"元霆数据"</span>
					    </div>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline">
					    <label class="layui-form-label">行业</label>
					    <div class="layui-input-inline" style="width:330px">
					      	<select name="dicIndustryId" id="dicIndustryId" lay-filter="aihao">
						        <option value="">请选择</option>
						    </select>
					    </div>
					</div>
					<div class="layui-inline">
					    <label class="layui-form-label" style="width:30px">阶段</label>
					    <div class="layui-input-inline" style="width:120px">
					    	<select name="dicStageId" id="dicStageId" lay-filter="aihao">
						        <option value="">请选择</option>
						    </select>
					    </div>
					</div>
				</div>
				
				<div class="layui-form-item">
				    <div class="layui-inline">
				      <label class="layui-form-label">重要客户</label>
				      <div class="layui-input-inline">
				        	<input name="importantCustomer" title="是" type="radio" value="1" />
			     	 		<input name="importantCustomer" title="否" type="radio" value="0" checked="checked"/>
				      </div>
				    </div>
				    <div class="layui-inline">
				      <label class="layui-form-label"  style="width:90px">是否外部可见</label>
				      <div class="layui-input-inline">
				        	<input name="externallyVisible" title="是" type="radio" value="1" />
			     	 		<input name="externallyVisible" title="否" type="radio" value="0"  checked="checked"/>
				      </div>
				    </div>
				</div>
				
				<div class="layui-form-item">
				    <label class="layui-form-label">企业资质</label>
				    <div class="layui-input-block">
			      		<input name="enterpriseQualification" title="已确认企业合法性" type="radio" value="1" />
			     	 	<input name="enterpriseQualification" title="未确认企业合法性" type="radio" value="0" checked="checked"/>
				    </div>
				</div>
				<div class="layui-form-item">
				    <label class="layui-form-label">简介</label>
				    <div class="layui-input-block">
				      	<textarea placeholder="请输入内容" id="brief" th:text="${record.brief}" required name="brief" class="layui-textarea"></textarea>
				    	<span style="color: rgb(153, 153, 153); font-size: 12px; padding: 4px 0px 0px;">公司的简单介绍,外部可见</span>
				    </div>
				</div>
				<div class="layui-form-item">
				    <label class="layui-form-label">备注</label>
				    <div class="layui-input-block">
				      	<textarea placeholder="请输入内容" id="remarks" th:text="${record.remarks}" required name="remarks" class="layui-textarea"></textarea>
				    </div>
				</div>
			</fieldset>
			
			<fieldset class="fieldset">
	           <legend>负责人信息</legend>
					<div class="layui-form-item">
					<div class="layui-inline">
					    <label class="layui-form-label"><span class="must-fill">*</span>姓名</label>
					    <div class="layui-input-inline" style="width:210px">
					      	<input type="text" name="chargeName" id="chargeName" th:value="${record.chargeName}" lay-verify="chargeName" placeholder="" autocomplete="off" class="layui-input">
					    </div>
					</div>
					<div class="layui-inline">
					    <label class="layui-form-label" style="width:40px"><span class="must-fill">*</span>手机</label>
					    <div class="layui-input-inline" style="width:230px">
					    	<input type="text" name="chargePhone" id="chargePhone" th:value="${record.chargePhone}" lay-verify="chargePhone" placeholder="" autocomplete="off" class="layui-input">
					    </div>
					</div>
				</div>
				<div class="layui-form-item">
				    <label class="layui-form-label" ><span class="must-fill">*</span>邮箱</label>
				    <div class="layui-input-block">
				    	<input type="text" name="chargeMail" id="chargeMail" th:value="${record.chargeMail}" lay-verify="chargeMail" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				</div>
				
			</fieldset>
			
			<fieldset class="fieldset">
	           <legend>客户信息</legend>
				<div class="layui-form-item">
				    <label class="layui-form-label">客户</label>
				    <div class="layui-input-block">
				      	<input type="text" name="" id="" placeholder="" autocomplete="off" class="layui-input">
				    </div>
				</div>
			</fieldset>
			
			<fieldset class="fieldset">	
				<div class="layui-form-item" style="">
				    <div class="layui-input-block">
				      <button class="layui-btn layui-btn-normal btn-bg" lay-submit lay-filter="formEmployee" id="submit-btn">提交</button>
				      <a class="layui-btn layui-btn-primary" onclick="closeLayer()">取消</a>
				    </div>
				</div>
			</fieldset>
		</form>	
	</div>
</div>
</body>
<script>
	
	layui.config({
	        base: '/js/plugin/layui-v2.3.0/layui/' //此处路径请自行处理, 可以使用绝对路径
	    }).extend({
	        formSelects: 'formSelects-v3'
	    }).use(['element',"layer","form",'formSelects'], function(){
			var layer=layui.layer,form = layui.form,formSelects = layui.formSelects;
			 
			form.verify({
				fullName: function(value, item){ //value：表单的值、item：表单的DOM对象
		      	  if(value==""){
			       	  return '全称不能为空';
			      }
			  }
				,simpleName: function(value, item){ //value：表单的值、item：表单的DOM对象
		      	  if(value==""){
			       	  return '简称不能为空';
			      }
			  }
				,chargeName: function(value, item){ //value：表单的值、item：表单的DOM对象
		      	  if(value==""){
			       	  return '负责人姓名不能为空';
			      }
			  }
			  ,chargePhone: function(value, item){ //value：表单的值、item：表单的DOM对象
		      	  if(value==""){
			       	  return '负责人手机不能为空';
			      }
			  }
			  ,chargeMail: function(value, item){ //value：表单的值、item：表单的DOM对象
			    if(value==""){
			    	return '负责人邮箱不能为空';
			    }
			  }
			  
			  
			}); 
			//监听提交
			  form.on('submit(formEmployee)', function(data){
				  $.post($("#defaultForm").attr('action'), data.field, function(result) {
						window.parent.layer.msg(result.msg);
						closeLayer();
					}, 'json');
					return false;
			  });
			
		});
</script>
</html>